import prompt from '@system.prompt';
export default {
    data: {
        direction: 'column',
    list: [],
        todolist: [{
                       title: '刷题',
                       date: '2021-12-31 10:00:00',
            section:"A"
                   }, {
                       title: '看电影',
                       date: '2021-12-31 20:00:00',
            section:"A"
                   },{
            title: '刷题',
            date: '2021-12-31 10:00:00',
            section:"A"
        }, {
                       title: '看电影',
                       date: '2021-12-31 20:00:00',
            section:"A"
                   },{
            title: '刷题',
            date: '2021-12-31 10:00:00',
            section:"E"
        }, {
                       title: '看电影',
                       date: '2021-12-31 20:00:00',
            section:"E"
                   },{
            title: '刷题',
            date: '2021-12-31 10:00:00',
            section:"G"
        }, {
                       title: '看电影',
                       date: '2021-12-31 20:00:00',
            section:"H"
                   },{
            title: '刷题',
            date: '2021-12-31 10:00:00',
            section:"H"
        }, {
                       title: '看电影',
                       date: '2021-12-31 20:00:00',
            section:"H"
                   },{
            title: '刷题',
            date: '2021-12-31 10:00:00',
            section:"K"
        }, {
                title: '看电影',
            date: '2021-12-31 10:00:00',
        section:"K"
                   },

                   {
                       title: '看电影',
                       date: '2021-12-31 10:00:00',
                       section:"K"

                   },

        ],
    },
    scroll(e){
        console.log('scrollX:'+e.scrollX);
        console.log('scrollY:'+e.scrollY);
        console.log('scrollState:'+e.scrollState);
    },
    scrollBottom(){
        console.log('---scroll bottom')
    },
    scrollTop(){
        console.log('---scroll top')
    },

//    list-item-group
    onInit() {
        this.list = []
        this.listAdd = []
        for (var i = 1; i <= 3; i++) {
            var dataItem = {
                value: 'GROUP' + i,
            };
            this.list.push(dataItem);
        }
    },
    collapseOne(e) {
        this.$element('mylist').collapseGroup({
            groupid: 'GROUP1'
        })
    },
    expandOne(e) {
        this.$element('mylist').expandGroup({
            groupid: 'GROUP1'
        })
    },
    collapseAll(e) {
        this.$element('mylist').collapseGroup()
    },
    expandAll(e) {
        this.$element('mylist').expandGroup()
    },
    collapse(e) {
        prompt.showToast({
            message: 'Close ' + e.groupid
        })
    },
    expand(e) {
        prompt.showToast({
            message: 'Open ' + e.groupid
        })
    }

}
